<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <title>定时器与延时器</title>
  </head>
  <body>
    <script>
    //   function say() {
    //     console.log("你好");
    //   }
    //   setTimeout(say, 2000);

    //   for (var i = 1; i <= 10; i++) {
    //     setTimeout(function() {
    //       console.log(i);
    //     }, 1000);
    //   }abcd
    //   console.log(i)
    let x = 1
    // let y = prompt('abc')
    // let timerID = setTimeout(function(){
    //     console.log(`异步运行x=${x}`)
    // },2000)
    
    // x++
    // console.log(`同步运行x=${x}`)

    let timerID1 = setInterval(function(){
        x++
        console.log(x)
    },1000)
    </script>
  </body>
</html>
